#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:4996)
#include<stdio.h>

int main()
{
	int pocket_money = 300;
	int budget[13];
	int money_self = 0;
	int money_mom = 0;
	int money_sum = 0;
	int i,j,k;
	for (j = 0; j < 12; j++)
	{
		scanf("%d", &budget[j+1]);
	}

	for (i = 0; i < 12; i++)
	{
		money_self = money_self + pocket_money;
		money_self = money_self - budget[i+1];
		if (money_self < 0)
		{
			printf("%d", -i - 1);
			system("pause");
			return 0;
		}
		k = money_self / 100;
		money_self = money_self - k * 100;
		money_mom = money_mom + k * 100;
	}
	money_sum = money_sum + money_self + (int)(1.2 * money_mom);
	printf("%d", money_sum);
}